﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.Odbc;
using Gestion_Api.AccesoDatos;
using System.Data.SqlClient;

namespace Escuela
{
    public partial class cursosProfesores : Form
    {
        int idProfesor;
        public cursosProfesores(int idProfesor, string nombre, string apellido)
        {
            InitializeComponent();
            this.maskedNroAl.Text = idProfesor.ToString();
            this.txtNom.Text = nombre;
            this.txtApe.Text = apellido;
            this.idProfesor = idProfesor;
        }

        private void cursosProfesores_Load(object sender, EventArgs e)
        {
            this.cargarData2();
        }

        private void cargarData2()
        {
            string query = null;

            DataTable dt = new DataTable();
            AccesoDB ac = new AccesoDB();
            query = "coop_alumno_ver_cursos " + this.idProfesor;
            SqlCommand command = new SqlCommand();
            //command.Connection = connection;
            command.CommandText = query;
            command.CommandType = CommandType.Text;
            dt = ac.execDT(command);

           
            this.dataGridView1.DataSource = dt;

        }

        private void Cerrar_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void panel2_Paint(object sender, PaintEventArgs e)
        {

        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }
    }
}
